/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.entity.ac;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fuyao.cloud.asset.util.AssetUtils;
import com.fuyao.cloud.common.core.model.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 验收管理
 *
 * @author liyue
 * @date 2021-12-03 09:41:17
 */
@Data
@TableName("fy_asset_ac")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "验收管理")
public class AssetAc extends BaseEntity<AssetAc> {

    /**
     * 唯一编码（用于关联附件）
     */
    @ApiModelProperty(value="唯一编码（用于关联附件）")
    private String unid;

    /**
     * 单据类型：默认为ALL{ DEVICE:资产类；CONSUMABLES：易耗品；All:混合}
     */
    @ApiModelProperty(value="单据类型")
    private String type;

    /**
     * 单号
     */
    @ApiModelProperty(value="单号")
    private String caseid;

    /**
     * 采购订单ID
     */
    @ApiModelProperty(value="采购订单ID")
    private Long parentId;

    /**
     * 采购订单号
     */
    @ApiModelProperty(value="采购订单号")
    private String parentCaseid;

    /**
     * 批次号
     */
    @ApiModelProperty(value="批次号")
    private String batchnumber;

    /**
     * 合同或发票ID
     */
    @ApiModelProperty(value="合同或发票ID")
    private Long contractId;

    /**
     * 合同或发票编号
     */
    @ApiModelProperty(value="合同或发票编号")
    private String contractNumber;

    /**
     * 合同或发票名称
     */
    @ApiModelProperty(value="合同或发票名称")
    private String contractName;

    /**
     * 状态：默认为0{0：草稿、1：处理中、2：已审批、3：已完成、4：作废}当验收单点击入库操作完成后更改为3：已完成
     */
    @ApiModelProperty(value="状态：默认为0{0：草稿、1：处理中、2：已审批、3：已完成、4：作废}当验收单点击入库操作完成后更改为3：已完成")
    private String status;

    /**
     * 供应商ID
     */
    @ApiModelProperty(value="供应商ID")
    private Long supplierId;

    /**
     * 供应商名称
     */
    @ApiModelProperty(value="供应商名称")
    private String supplierName;

    /**
     * 收货时间
     */
    @ApiModelProperty(value="收货时间")
    private LocalDateTime receivTime;

    /**
     * 入库时间
     */
    @ApiModelProperty(value="入库时间")
    private LocalDateTime inTime;

    /**
     * 到货时间
     */
    @ApiModelProperty(value="到货时间")
    private LocalDateTime arrivalDatetime;

    /**
     * 存放房间名称
     */
    @ApiModelProperty(value="存放房间名称")
    private String houseName;

    /**
     * 存放房间ID
     */
    @ApiModelProperty(value="存放房间ID")
    private Long houseId;

    /**
     * 存放位置名称
     */
    @ApiModelProperty(value="存放位置名称")
    private String locationName;

    /**
     * 存放位置id
     */
    @ApiModelProperty(value="存放位置id")
    private Long locationId;

    /**
     * 存放地点全名称
     */
    @ApiModelProperty(value="存放地点全名称")
    private String fullLocation;

    /**
     * 采购方式01：邀标、02：自采:03：政府采购
     */
    @ApiModelProperty(value="采购方式01：邀标、02：自采:03：政府采购")
    private String method;

    /**
     * 验收总价格
     */
    @ApiModelProperty(value="验收总价格")
    private BigDecimal amount;

    /**
     * 货币类型默认人民币：人民币：、欧元：欧元、美元：美元、法元：法元
     */
    @ApiModelProperty(value="货币类型默认人民币：人民币：、欧元：欧元、美元：美元、法元：法元")
    private String currencyType;

    /**
     * 订单明细
     */
    @ApiModelProperty(value="订单明细")
    private String detailed;

    /**
     * 验收说明
     */
    @ApiModelProperty(value="验收说明")
    private String explains;

    @TableField(exist = false)
    @ApiModelProperty("验收明细")
    private List<AssetAcList> acList;

	public String getDetailedEx() {
		return AssetUtils.formatDetailed(this.detailed);
	}

	public String getStatusCn(){
		return AssetUtils.formatStatus(this.status);
	}

}
